package services;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.aton.db.SessionFactory;

import models.mappers.BackCountMapper;
import models.mappers.BackInfoMapper;
import vos.BackCountVo;
import vos.BackInfoVo;
import vos.CountHistorySearchVo;

public class CountHistoryService {
	/**
	 * 统计历史信息数量
	 *
	 * @Title: countCountHistory 
	 * @param vo
	 * @return
	 * @return: long
	 */
	public static long countCountHistory(CountHistorySearchVo vo) {
		SqlSession ss = SessionFactory.getSqlSession();
		try {
			BackCountMapper mapper = ss.getMapper(BackCountMapper.class);
            return mapper.countCountHistory(vo);
        } finally {
            ss.close();
        }
	}
	/**
	 * 获取历史信息列表
	 *
	 * @Title: listCountHistory 
	 * @param vo
	 * @return
	 * @return: List<BackInfoVo>
	 */
	public static List<BackCountVo> listCountHistory(CountHistorySearchVo vo) {
		SqlSession ss = SessionFactory.getSqlSession();
		try {
			BackCountMapper mapper = ss.getMapper(BackCountMapper.class);
            return mapper.listCountHistory(vo);
        } finally {
            ss.close();
        }
	}
	/**
	 * 获取历史子表信息
	 *
	 * @Title: listSubHistory 
	 * @param vo
	 * @return
	 * @return: List<BackCountVo>
	 */
	public static List<BackCountVo> listSubHistory(CountHistorySearchVo vo) {
		SqlSession ss = SessionFactory.getSqlSession();
		try {
			BackCountMapper mapper = ss.getMapper(BackCountMapper.class);
            return mapper.listSubHistory(vo);
        } finally {
            ss.close();
        }
	}
	/**
	 * 统计历史子表数量
	 *
	 * @Title: countSubHistory 
	 * @param vo
	 * @return
	 * @return: long
	 */
	public static long countSubHistory(CountHistorySearchVo vo) {
		SqlSession ss = SessionFactory.getSqlSession();
		try {
			BackCountMapper mapper = ss.getMapper(BackCountMapper.class);
            return mapper.countSubHistory(vo);
        } finally {
            ss.close();
        }
	}

}
